/*
https://leetcode.cn/problems/maximum-depth-of-n-ary-tree/
559. N 叉树的最大深度
*/
/*
// Definition for a Node.
class Node {
public:
    int val;
    vector<Node*> children;

    Node() {}

    Node(int _val) {
        val = _val;
    }

    Node(int _val, vector<Node*> _children) {
        val = _val;
        children = _children;
    }
};
*/

class Solution {
public:
    int maxDepth(Node* root) {
        if(root==NULL) return 0;
        int len=1;
        for(auto i:root->children){
            len=max(len,maxDepth(i)+1);
        }
        return len;
    }
};